
import http from '@/service/http'
import config from '../config'

const baseUrl = config.USER_ADMIN_URL

export const _getOrgByType = (type) => http.$GET(`${baseUrl}/organization/getOrganizationByType/${type}`) // 根据机构类型查询一级机构信息
export const _getListChildrenByCode = (params) => http.$POST(`${baseUrl}/organization/listChildrenByCode`, params) // 根据组织码查询下级组织机构信息
export const _getOrganizationAndChildrenByType = (type) => http.$GET(`${baseUrl}/organization/listOrgAndChild`) //根据组织机构类型查询整棵树结构
export const _postOrgAdd = (params) => http.$POST(`${baseUrl}/organization/add`, params) //添加新的部门
export const _postPageChildrenByCode = (params) => http.$POST(`${baseUrl}/organization/pageChildrenByCode`, params) //根据组织码分页查询下级组织机构信息 
export const _update = (params) => http.$PUT(`${baseUrl}/organization/update`, params)
export const _getOrganizationByCode = (code) => http.$GET(`${baseUrl}/organization/getOrganizationByCode/${code}`)
export const _deleteOrg = (id) => http.$DELETE(`${baseUrl}/organization/remove/${id}`)
export const _updateStatus = (id, status) => http.$PUT(`${baseUrl}/organization/updateStatus/${id}/${status}`)
export const _postListOrganizationHistory = (params) => http.$POST(`${baseUrl}/organization/listOrganizationHistory`, params)
export const _getListOperateType = () => http.$GET(`${baseUrl}/organization/listOperateType`)
export const _getListOrganizationAndChildren = () => http.$GET(`${baseUrl}/organization/listOrganizationAndChildren`)
export const _postListJobByCondition = (params) => http.$POST(`${baseUrl}/job/listJobByCondition`, params)
export const _postPageNextLevelChildrenByCode = (params) => http.$POST(`${baseUrl}/organization/getOrgAndChild`, params)
//获取人员管理列表
export const _getOrgUserList = (id) => http.$GET(`${baseUrl}/organization/users/${id}`)
//修改用户组织
export const _postChangeRef = (params) => http.$POST(`${baseUrl}/organization/changeRef`, params)
//获取负责人列表
export const _getDataUserList = (params) => http.$POST(`${baseUrl}/organization/listUser`, params)
//修改负责人
export const _postChangePrincipal = (params) => http.$POST(`${baseUrl}/organization/changePrincipal`, params)
//获取下拉列表组织
export const _getAllOrgList = (id) => http.$GET(`${baseUrl}/organization/listAll`)
//获取已选择负责人
export const _getPriSelect = (id) => http.$GET(`${baseUrl}/organization/listPri/${id}`)





